package util;

import java.util.Random;

public class Gerador {
	
	public static Double getExponencial(Double taxa) {
		Random random = new Random();
		final double u0 = random.nextDouble();
		return -Math.log(u0) / taxa;
	}
	
	public static Double getNormal(Double media, Double desvioPadrao) {
		Random random = new Random();
		double y = 0.0;
		
		while(y < 0.0) {
			final double u = random.nextGaussian();
			y = u*desvioPadrao + media;
		}

		return y;
	}
	
	public static Double getDeterministico(Double taxa) {
		return 1/taxa;
	}
	
}
